跳到主要内容

ssh  root 登录

sudo vim /etc/ssh/sshd_config

找到并用#注释掉这行:PermitRootLogin prohibit-password

新建一行 添加:PermitRootLogin yes

密码登陆

PasswordAuthentication yes

公钥登录

PubkeyAuthentication yes

重启服务

#sudo service ssh restart

sudo passwd root #设置密码